﻿Imports System.Windows.Forms
Imports System.ComponentModel

<TypeDescriptionProvider(GetType(BaseFormProvider)), _
BaseForm(GetType(BasicDataFormDesigner))> _
Public MustInherit Class BasicDataForm
    Inherits BasicDataFormDesigner

#Region " Métodos a heredar"

    Protected Friend MustOverride Function ValidateData() As Boolean
    Protected Friend MustOverride Function SaveData() As Boolean
#End Region

#Region " Propiedades"

    Private _new As Boolean
    ''' <summary>
    ''' Obtiene o establece el estado del registro.
    ''' </summary>
    Public Property isNew() As Boolean
        Get
            Return _new
        End Get
        Set(ByVal value As Boolean)
            _new = value
        End Set
    End Property

    Private _active As Boolean = True
    ''' <summary>
    ''' Obtiene o establece si el registro está activo
    ''' </summary>
    Public Property isActive() As Boolean
        Get
            Return _active
        End Get
        Set(ByVal value As Boolean)
            _active = value
        End Set
    End Property
#End Region

#Region " Métodos Privados"

    ''' <summary>
    ''' Assigna las propiedades a los controles dependiendo de los permisos assignados
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub ControlsProperties()
        ' Controla el estado de los controles de la pantalla
        If isNew Then
            ' No implementado
        End If

        If Not isActive Then
            ' No implementado
            btnOK.Visible = False
        End If
    End Sub

    Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If ValidateData() Then
            SaveData()
        End If
    End Sub
#End Region

#Region " Constructores"

    Public Sub New()
        InitializeComponent()
    End Sub

#End Region

End Class